package cn.ainit.test.web;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

@Service("userManagerBase")
public class UserManagerImpl implements UserManager {

	private UserDao userDao;
	
	@Resource
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public User getUser(String id) {
		return userDao.getUser(id);
	}

	@Override
	public List<User> getAllUser(){
		List<User> list=new ArrayList<User>();
		try {
			list=userDao.getAllUser();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}

	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	@Override
	public boolean delUser(String id) {
		return userDao.delUser(id);
	}

	@Override
	public boolean updateUser(User user) {
		return userDao.updateUser(user);
	}

	@Override
	public List testTemp() {
		return userDao.testTemp();
	}
}
